#!/bin/bash

ORIGIN_DIR=$(dirname $(readlink -f "$0"))
TARGET_DIR="/usr/share/deepin/dde-file-manager/oem-menuextensions"
ORIGIN_FILE="root-file-manager.desktop"

pkexec cp -f ${ORIGIN_DIR}/${ORIGIN_FILE} ${TARGET_DIR}

if [[ -f "${TARGET_DIR}/${ORIGIN_FILE}" ]] ; then
    echo "安装成功"
    echo "即将打开一个新文件管理器窗口，请自行确认效果"
    dde-open /
else
    echo "安装失败"
fi
